<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .con{
            width:300px;  
            height: 300px;  
            background: rgb(231, 212, 209);
            position: relative;
        }
        .child{
            width: 100px;
            height: 100px;
            background: rgb(216, 157, 216);
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            /* margin-left: -50px;
            margin-top: -50px; */
        }
    </style>
</head>
<body>
    <div class="con">
        <div class="child"></div>
    </div>
</body>
</html>